package com.jyh.homework.t5;

import java.io.*;
import java.util.Scanner;

/**
 * @Author JYH
 * @Date 2024/8/6 19:22
 * @Description 1、使用从键盘输入三句话，用PrintStream打印到一个words.txt文件中
                2、再用Scanner一行一行读取显示
 */
public class T5 {
    public static void main(String[] args) throws IOException {
        PrintWriter pw = new PrintWriter(new FileWriter("D:\\Study\\JavaSE-plus\\JavaSE-code\\day10-code\\src\\com\\jyh\\homework\\t5\\words.txt"), true);
        Scanner scanner = new Scanner(System.in);

        for (int i = 0; i < 3; i++) {
            System.out.println("请输入第"+(i+1)+"句话:");
            String s = scanner.nextLine();
            pw.println(s);
        }
        pw.close();

    }
}
